package com.geeker.module.sys.user.controller;

import com.geeker.common.annotation.Log;
import com.geeker.common.api.CommonResult;
import com.geeker.common.enums.BusinessType;
import com.geeker.module.sys.user.dto.UpdatePwdDto;
import com.geeker.module.sys.user.sevice.SysProfileService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "个人信息")
@RestController
@RequestMapping("/system/user/profile")
public class SysProfileController {

    @Autowired
    private SysProfileService sysProfileService;

    @Operation(summary = "重置密码")
    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
    @PostMapping("/updatePwd")
    public CommonResult updatePwd(@RequestBody @Valid UpdatePwdDto dto) {
        return sysProfileService.updatePwd(dto);
    }
}
